import java.io.IOException;

public class Main{

	/**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		java.io.BufferedReader r = new java.io.BufferedReader(
				new java.io.InputStreamReader(System.in));

		while (true) {
			if (!r.ready()) {
				 break;
			}
			String s = r.readLine();
			String result = "";
			if (s.charAt(s.length() - 1) == '_' || s.charAt(0) <= '_'
					|| s.indexOf("__") > 0) {
				result = "Error!";
			} else {
				int in = s.indexOf('_');
				if (in >= 0) {
					String temp = "";
					boolean error = false;
					for (int i = 0; i < s.length(); i++) {
						if (s.charAt(i) < 95) {
							error = true;
						}
					}
					if (error) {
						result = "Error!";

					} else {
						temp = s;
						while (in >= 0) {
							result += temp.substring(0, in);
							result += (char) (temp.charAt(in + 1) - 32);
							temp = temp.substring(in + 2);
							in = temp.indexOf('_');
						}
						result += temp;
					}
				} else {
					for (int i = 0; i < s.length(); i++) {
						if (s.charAt(i) < 'a') {
							result += "_" + (char) (s.charAt(i) + 32);
						} else {
							result += s.charAt(i);
						}
					}
				}
			}
			System.out.println(result);
		}
	}
}